//导入vue-router
import { createRouter, createWebHistory } from 'vue-router'

//导入页面
import DictionaryPage from '@/components/DictionaryPage.vue'
import WordsBank from '@/views/WordsBank.vue'
import Login from '@/views/LoginPage.vue'
import Regist from '@/views/RegistPage.vue'
import UserPolicy from '@/views/UserPolicy.vue'
import PrivatePolicy from '@/views/PrivatePolicy.vue'
import ForgetPassword from '@/views/ForgetPassword.vue'
import UserCenter from '@/views/UserCenter.vue'
import MyCoupon from '@/views/MyCoupon.vue'
import WXPayQRCode from '@/views/WxPayQRCode.vue'
import MyBill from '@/views/MyBill.vue'
import MyContribution from '@/views/MyContribution.vue'
import H5promotion from '@/views/H5promotion.vue'
import ChargingPolicy from '@/views/ChargingPolicy.vue'
import MyFavor from '@/views/MyFavor.vue'
import ConsolePage from '@/components/ConsolePage.vue'
import FinancialPage from '@/views/FinancialPage.vue'
import ReviewPage from '@/views/ReviewPage.vue'

const routes = [
  // 定义您的路由配置
  {
    path:'/dictionary/:param1?',
    name:'Dictionary',
    component:DictionaryPage,
    children:[
      {
        path:'',
        name:'Wordsbank',
        component:WordsBank,
        props:{param1:'all'}
      },  
      
    ], 
  },
  {
    path:'/console',
    name:'ConsolePage',
    component:ConsolePage,
    redirect:'/console/review',
    children:[
      {
        path:'review',
        name:'Review',
        component:ReviewPage,
      },  
      {
        path:'financial',
        name:'Financial',
        component:FinancialPage,
      },  
    ], 
  },
  {
    path:'/',
    name:'Login',
    component:Login
  },
  {
    path:'/register',
    name:'Regist',
    component:Regist
  },
  {
    path:'/userpolicy',
    name:'UserPolicy',
    component:UserPolicy
  },{
    path:'/privatepolicy',
    name:'PrivatePolicy',
    component:PrivatePolicy
  },{
    path:'/forget',
    name:'ForgetPassword',
    component:ForgetPassword
  },{
    path:'/user_center',
    name:'UserCenter',
    component:UserCenter,
  },
  {
    path:'/my_coupon',
    name:'MyCoupon',
    component:MyCoupon,
  },
  {
    path:'/wx_pay_url_qrcode/:order_id/:amount/:user_id/:qrcode',
    name:'wx_pay_url_qrcode',
    component:WXPayQRCode,
  },  
  {
    path:'/mybill',
    name:'mybill',
    component:MyBill,
  },{
    path:'/my_contribution',
    name:'MyContribution',
    component:MyContribution,
    children:[
      {
        path:'/wordsbank/:param1',
        name:'WordsBank',
        component:WordsBank,
      }
    ],
  },{
    path:'/H5promotion',
    name:'H5promotion',
    component:H5promotion,
  },{
    path:'/ChargingPolicy',
    name:'ChargingPolicy',
    component:ChargingPolicy,
  },{
    path:'/myfavor',
    name:'MyFavor',
    component:MyFavor,
    children:[
      {
        path:'/wordsbank/:param1',
        name:'WordsBank',
        component:WordsBank,
      }
    ],
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
